package generics;

import object.Point;

import java.util.ArrayList;
import java.util.HashSet;

/**
 * 测试泛型边界
 */
public class Demo2 {
    public static void main(String[] args) {
        //编译不通过，因为Point没有继承自Collection
//        TransferObject2<Point> t = new TransferObject2<Point>();
        //指定实际类型时必须是Collection或它的子类型
        TransferObject2<ArrayList> t = new TransferObject2<>();
        TransferObject2<HashSet> t2 = new TransferObject2<>();
    }
}
